package cn.xiaolang.function.design_pattern.dynamic.proxy.pattern.jdk;


public class GetStarted {

    public static void main(String[] args) {

        // 实现接口的类
        AnimalServiceImpl delegate = new AnimalServiceImpl();
        // 代理工厂
        JdkProxyFactory proxyFactory = new JdkProxyFactory(delegate);
        // 代理实例
        AnimalService animal = (AnimalService) proxyFactory.getProxyInstance();
        animal.eat();
        animal.sleep();

    }
}
